package top.pmwly.CSRF.Controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author Herther
 * @version 1.0.0
 * @ClassName pageController.java
 * @Description 页面跳转控制
 * @createTime 2021年08月19日 17:18:00
 */
@Controller
public class pageController {

    @PreAuthorize("hasAnyRole('admin')")
    @PostMapping("/toMain")
    public String toMain() {
        return "redirect:main.html";
    }

    @PostMapping("/toError")
    public String toError(){
        return "redirect:error.html";
    }

    @RequestMapping("/demo")
    public String toDemo(){
        return "demo";
    }

    @RequestMapping("/showLogin")
    public String showLogin(){
        return "login";
    }
}
